#include "play.h"
#include <QPainter>
#include <QDebug>

Play::Play()
{
    play = false;
    pict.load(":/pictures/arts/play.png");
}

void Play::paint(QPainter *painter, const QRect &rect) const
{
    painter->save();
    painter->setRenderHint(QPainter::Antialiasing, true);
    painter->setPen(Qt::NoPen);
    QRectF source(0.0, 0.0, 30.0, 30.0);
    painter->drawImage(rect, pict, source);
    painter->restore();
}

QSize Play::sizeHint() const
{
    return pict.size();
}

void Play::setPlay(const bool play)
{
    if(play)
        pict.load(":/pictures/arts/pause.png");
    else
        pict.load(":/pictures/arts/play.png");
    this->play = play;
}
